package com.yanghs.common.entity.hbm;

import java.io.Serializable;
import java.util.Collection;

/**
 * @author yanghs
 * @Description:
 * @date 2018/3/14 21:27
 */
public class Authority implements Serializable{
    private static final long serialVersionUID = 1L;
    private String authorityid;
    private String pauthorityid;
    private String authorityname;
    private String url;
    private String authorityidpath;
    private String authoritynamepath;
    private String usable;
    private String authoritype;
    private String description;

    //不序列化
    private transient Collection<RoleAuthority> roleAuthoritiesByAuthorityid;

    public String getAuthorityid() {
        return authorityid;
    }

    public void setAuthorityid(String authorityid) {
        this.authorityid = authorityid;
    }

    public String getPauthorityid() {
        return pauthorityid;
    }

    public void setPauthorityid(String pauthorityid) {
        this.pauthorityid = pauthorityid;
    }

    public String getAuthorityname() {
        return authorityname;
    }

    public void setAuthorityname(String authorityname) {
        this.authorityname = authorityname;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAuthorityidpath() {
        return authorityidpath;
    }

    public void setAuthorityidpath(String authorityidpath) {
        this.authorityidpath = authorityidpath;
    }

    public String getAuthoritynamepath() {
        return authoritynamepath;
    }

    public void setAuthoritynamepath(String authoritynamepath) {
        this.authoritynamepath = authoritynamepath;
    }

    public String getUsable() {
        return usable;
    }

    public void setUsable(String usable) {
        this.usable = usable;
    }

    public String getAuthoritype() {
        return authoritype;
    }

    public void setAuthoritype(String authoritype) {
        this.authoritype = authoritype;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Authority authority = (Authority) o;

        if (authorityid != null ? !authorityid.equals(authority.authorityid) : authority.authorityid != null)
            return false;
        if (pauthorityid != null ? !pauthorityid.equals(authority.pauthorityid) : authority.pauthorityid != null)
            return false;
        if (authorityname != null ? !authorityname.equals(authority.authorityname) : authority.authorityname != null)
            return false;
        if (url != null ? !url.equals(authority.url) : authority.url != null) return false;
        if (authorityidpath != null ? !authorityidpath.equals(authority.authorityidpath) : authority.authorityidpath != null)
            return false;
        if (authoritynamepath != null ? !authoritynamepath.equals(authority.authoritynamepath) : authority.authoritynamepath != null)
            return false;
        if (usable != null ? !usable.equals(authority.usable) : authority.usable != null) return false;
        if (authoritype != null ? !authoritype.equals(authority.authoritype) : authority.authoritype != null)
            return false;
        if (description != null ? !description.equals(authority.description) : authority.description != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = authorityid != null ? authorityid.hashCode() : 0;
        result = 31 * result + (pauthorityid != null ? pauthorityid.hashCode() : 0);
        result = 31 * result + (authorityname != null ? authorityname.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (authorityidpath != null ? authorityidpath.hashCode() : 0);
        result = 31 * result + (authoritynamepath != null ? authoritynamepath.hashCode() : 0);
        result = 31 * result + (usable != null ? usable.hashCode() : 0);
        result = 31 * result + (authoritype != null ? authoritype.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }

    public Collection<RoleAuthority> getRoleAuthoritiesByAuthorityid() {
        return roleAuthoritiesByAuthorityid;
    }

    public void setRoleAuthoritiesByAuthorityid(Collection<RoleAuthority> roleAuthoritiesByAuthorityid) {
        this.roleAuthoritiesByAuthorityid = roleAuthoritiesByAuthorityid;
    }
}
